﻿using System.Collections;
using System.Collections.Generic;
using BearUtil.Hidden;
using Sirenix.OdinInspector;
using UnityEngine;
namespace BearUtil
{
	[CreateNodeMenu("自定义节点/角色移动"), Title("角色移动")]
	public class ActorMove : BearNode
	{
		[LabelText("节点类型"), HideInInspector]
		public int type = 3;
		[SerializeField, HideLabel, ValueDropdown("GetActors"), OnValueChanged("setRoleId")]
		public ActorData _actor;
		private ActorData[] GetActors()
		{
			var storyGraph = ((graph as DialogGraph)?.owner.graph as StoryGraph);
			if (storyGraph != null)
			{
				var series = StoriesSetting.Instance.FindSeriesByStoryGraph(storyGraph);
				return series.Actors.ToArray();
			}
			return new ActorData[0];
		}

		[LabelText("角色id")]

		public int role_id_move;
		private void setRoleId(ActorData actor)
		{
			role_id_move = _actor.role_id;
		}
		[LabelText("终点位置X")]
		public float role_move_pos_x = 0f;
		[LabelText("终点位置Y")]
		public float role_move_pos_y = 0f;
		[LabelText("镜头是否跟随")]
		public bool camera_follow = false;
		[LabelText("朝向")]
		public ObjectDirection item_direction = ObjectDirection.Up;
	}
}
